-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added auto shapes #175
base: develop
Are you sure you want to change the base?
added auto shapes #175
Conversation
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
I think we at least need a test that the code runs, if not that it trains to a reasonable performance.
CRITERIONS = ['entropy', 'var'] | ||
|
||
|
||
def _to_list(p): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring here and everywhere with the style
"""One line TLDR.
(optional details)
Args:
arg1: ...
Returns:
lorem ipsum
"""
|
||
def _roundrobin(*iterables): | ||
"roundrobin('ABC', 'D', 'EF') --> A D E B F C" | ||
# Recipe credited to George Sakkis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you obeying the license of this code if it is not you who wrote it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from the examples here https://docs.python.org/2.7/library/itertools.html#recipes
t3f/nn.py
Outdated
|
||
|
||
class KerasDense(Layer): | ||
_counter = count(0) | ||
|
||
def __init__(self, input_dims, output_dims, tt_rank=2, | ||
def __init__(self, in_dim=None, out_dim=None, d=None, mode='mixed', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the naming in_dim vs input_dims. Maybe in_dim vs in_shape?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, do you actually need in_dims? Can you use just "units" like keras does?
return _to_list(factorint(p)) | ||
|
||
|
||
def auto_shape(n, d=3, criterion='entropy', mode='ascending'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have default d here but not in KerasDense. Is it intentional?
return list(factors[i]) | ||
|
||
|
||
def suggest_shape(n, d=3, criterion='entropy', mode='ascending'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this one?
No description provided.